﻿// Decompiled with JetBrains decompiler
// Type: Abp.AspNetZeroCore.Licensing.AspNetZeroBaseLicenseChecker
// Assembly: Abp.AspNetZeroCore, Version=1.1.6.0, Culture=neutral, PublicKeyToken=null
// MVID: 698A3DA9-6833-4753-A3DC-A6AD5D2A144E
// Assembly location: E:\LarryleWork\WorkItems\PWA APP\SRC\GitCode\ProjectAppServer\aspnet-core\src\MyCompanyName.AbpZeroTemplate.Web.Core\bin\Debug\net461\Abp.AspNetZeroCore.dll

using Abp.Zero.Configuration;
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Abp.AspNetZeroCore.Licensing
{
  public abstract class AspNetZeroBaseLicenseChecker
  {
    private readonly IAbpZeroConfig _abpZeroConfig;

    private string LicenseCode { [MethodImpl(MethodImplOptions.NoInlining)] get; }

    protected abstract string GetSalt();

    protected abstract string GetHashedValueWithoutUniqueComputerId(string str);

    [MethodImpl(MethodImplOptions.NoInlining)]
    protected AspNetZeroBaseLicenseChecker(AspNetZeroConfiguration configuration, IAbpZeroConfig abpZeroConfig, string configFilePath = "")
    {
      int num1;
      if (AspNetZeroBaseLicenseChecker.gP14KHjngpCqiks9mt())
      {
        int num2 = 1;
        if (AspNetZeroBaseLicenseChecker.gP14KHjngpCqiks9mt())
        {
          num1 = num2;
          goto label_5;
        }
      }
      else
        goto label_7;
label_2:
      AspNetZeroBaseLicenseChecker.fRuSKdqKZxcDcuulmY((object) this);
      num1 = 3;
label_5:
      while (true)
      {
        switch (num1)
        {
          case 0:
          case 1:
            goto label_2;
          case 3:
            this._abpZeroConfig = abpZeroConfig;
            goto default;
          case 5:
            goto label_6;
          default:
            this.LicenseCode = (string) AspNetZeroBaseLicenseChecker.Io2Ou7DAK1hQLqOgJG((object) configuration);
            int num3 = 5;
            if (true)
            {
              num1 = num3;
              continue;
            }
            goto case 3;
        }
      }
label_6:
      return;
label_7:
      num1 = 4;
      goto label_5;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    protected string GetLicenseCode()
    {
      return this.LicenseCode;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    protected bool CompareProjectName(string hashedProjectName)
    {
      int num1;
      if (AspNetZeroBaseLicenseChecker.gP14KHjngpCqiks9mt())
      {
        int num2 = 4;
        if (true)
        {
          num1 = num2;
          goto label_20;
        }
      }
      else
        goto label_3;
label_2:
      string[] strArray = (string[]) AspNetZeroBaseLicenseChecker.V727VZKGUvS3hBDhMG((object) this.GetAssemblyName(), (object) new char[1]
      {
        '.'
      });
      goto label_18;
label_3:
      num1 = 3;
      goto label_20;
label_18:
      int index1 = 0;
      num1 = 7;
label_20:
      int num3;
      string str;
      int index2;
      while (true)
      {
        switch (num1)
        {
          case 0:
          case 4:
            goto label_2;
          case 1:
          case 3:
            goto label_18;
          case 2:
            index2 = index1 - 1;
            num1 = 10;
            continue;
          case 5:
            goto label_16;
          case 6:
          case 7:
            if (index1 >= strArray.Length)
            {
              num1 = 15;
              continue;
            }
            num3 = 0;
            num1 = 9;
            continue;
          case 8:
            ++index1;
            num1 = 6;
            continue;
          case 9:
          case 11:
            if (num3 <= index1)
            {
              str = strArray[index1];
              num1 = 2;
              continue;
            }
            num1 = 8;
            continue;
          case 10:
          case 13:
            if (index2 > index1 - 1 - num3)
            {
              str = (string) AspNetZeroBaseLicenseChecker.p4kqDnBoiD0i1vYNLu((object) strArray[index2], (object) ".", (object) str);
              num1 = 12;
              continue;
            }
            num1 = 14;
            continue;
          case 12:
            --index2;
            goto case 10;
          case 14:
            if (AspNetZeroBaseLicenseChecker.GjfosWOKew6C4MZxXg((object) hashedProjectName, AspNetZeroBaseLicenseChecker.ElG9B090yAOuQoOllH((object) this, (object) str)))
            {
              int num2 = 5;
              if (true)
              {
                num1 = num2;
                continue;
              }
              goto case 10;
            }
            else
            {
              ++num3;
              int num2 = 11;
              if (AspNetZeroBaseLicenseChecker.gP14KHjngpCqiks9mt())
              {
                num1 = num2;
                continue;
              }
              goto label_18;
            }
          case 15:
            goto label_23;
          default:
            num1 = 13;
            continue;
        }
      }
label_16:
      return true;
label_23:
      return false;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    protected string GetAssemblyName()
    {
      return (string) AspNetZeroBaseLicenseChecker.Gh49aLxwID2Q36xNnK(AspNetZeroBaseLicenseChecker.M53PfP0HlWjKwJyjoa((object) AspNetZeroBaseLicenseChecker.mj0t4lcSuai0cXSlci(AspNetZeroBaseLicenseChecker.AMOxFA8r62xar5je9h((object) this._abpZeroConfig)).Assembly));
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    protected string GetLicenseController()
    {
      return "WebProject";
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    protected bool IsThereAReasonToNotCheck()
    {
      return !AspNetZeroBaseLicenseChecker.KsIHsHEY1sAwbCS4hy();
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static void fRuSKdqKZxcDcuulmY([In] object obj0)
    {
      // ISSUE: explicit constructor call
      obj0.\u002Ector();
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static object Io2Ou7DAK1hQLqOgJG([In] object obj0)
    {
      return (object) ((AspNetZeroConfiguration) obj0).LicenseCode;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static bool gP14KHjngpCqiks9mt()
    {
      return true;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static bool pfVKA1X4p4bqWQuRy1()
    {
      return false;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static object V727VZKGUvS3hBDhMG([In] object obj0, [In] object obj1)
    {
      return (object) ((string) obj0).Split((char[]) obj1);
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static object p4kqDnBoiD0i1vYNLu([In] object obj0, [In] object obj1, [In] object obj2)
    {
      return (object) ((string) obj0 + (string) obj1 + (string) obj2);
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static object ElG9B090yAOuQoOllH([In] object obj0, [In] object obj1)
    {
      return (object) ((AspNetZeroBaseLicenseChecker) obj0).GetHashedValueWithoutUniqueComputerId((string) obj1);
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static bool GjfosWOKew6C4MZxXg([In] object obj0, [In] object obj1)
    {
      return (string) obj0 == (string) obj1;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static object AMOxFA8r62xar5je9h([In] object obj0)
    {
      return (object) ((IAbpZeroConfig) obj0).EntityTypes;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static Type mj0t4lcSuai0cXSlci([In] object obj0)
    {
      return ((IAbpZeroEntityTypes) obj0).User;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static object M53PfP0HlWjKwJyjoa([In] object obj0)
    {
      return (object) ((Assembly) obj0).GetName();
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static object Gh49aLxwID2Q36xNnK([In] object obj0)
    {
      return (object) ((AssemblyName) obj0).Name;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    internal static bool KsIHsHEY1sAwbCS4hy()
    {
      return Debugger.IsAttached;
    }
  }
}
